package com.younion.vo;

import java.util.Date;

import com.younion.common.constants.TemplateScope;
import com.younion.util.DateUtil;

import cpcns.component.common.base.BaseVO;
import cpcns.persister.converter.IDomainObject;
import cpcns.persister.service.CompositeID;


 
public class ServiceInitVO extends BaseVO implements IDomainObject,Cloneable{

	/**  */
	private static final long serialVersionUID = -1L;

 
	private Integer id;

 
	private MsgTemplateVO template;

 
	private CardEntityVO cardEntity;
	
	private String msgType;
	
	private Date sendTime;
	
	private String typeTitle;

	/**
	 * 
	 */
	public ServiceInitVO() {
	}

	/** 
	 * @return the id
	 */ 
	public Integer getId() {
		return id;
	}

	/** 
	 * @param id the id to set 
	 */ 
	public void setId(Integer id) {
		this.id = id;
	}

	public MsgTemplateVO getTemplate() {
		return template;
	}

	public void setTemplate(MsgTemplateVO template) {
		this.template = template;
	}

	/** 
	 * @return the cardEntityId
	 */ 

	public CompositeID getCompositeID(){
		CompositeID _id = super.getCompositeID();
		_id.clear();
		if(id != null){
			_id.addKey("id", id);
		}
		return _id;
	}
	
	public String getMsgType() {
		return msgType;
	}

	public void setMsgType(String msgType) {
		this.msgType = msgType;
	}

	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}
	
	public String getMsgTypeTitle() {
		return (getMsgType() == null || "".equals(getMsgType()))  ? null : TemplateScope.valueOfName(getMsgType()).getTitle();
	}
	
	public String getSendTimeStr() {
		return DateUtil.toStrDateFromUtilDateByFormat(sendTime, DateUtil.DATE_TIME_FORMAT_YYYY_MM_DD_HH_MI_SS);
	}

	public CardEntityVO getCardEntity() {
		return cardEntity;
	}

	public void setCardEntity(CardEntityVO cardEntity) {
		this.cardEntity = cardEntity;
	}

	public String getTypeTitle() {
		return (this.getMsgType() == null || "".equals(getMsgType()))  ? null : TemplateScope.valueOfName(getMsgType()).getTitle();
	}

	public void setTypeTitle(String typeTitle) {
		this.typeTitle = typeTitle;
	}
	
	
}
